﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BOMS.Utility
{
    public class StringOp
    {
        /// <summary>
        /// MD5哈希加密
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static string HashData(string str)
        {
            str = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5");
            return str;
        }
        /// <summary>
        /// 返回当前时间的字符串格式
        /// </summary>
        /// <returns></returns>
        public static string DateTimeString()
        {
            string rt = DateTime.Now.ToShortDateString().Replace('/', '_') + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString();
            return rt;
        }
    }
}
